//
//  ConcreateSubject.hpp
//  Observer
//
//  Created by Shane on 17/9/18.
//  Copyright © 2017年 Shane. All rights reserved.
//

#ifndef ConcreteSubject_h
#define ConcreteSubject_h

#include <list>
#include "Subject.h"
#include "Observer.h"
using namespace std;


class ConcreteSubject : public Subject{
public:
    void attach(Observer *observer);
    void detach(Observer *observer);
    void notify();
    
    void setState(int state){
        m_state = state;
    }
private:
    std::list<Observer *> m_observerList;
    int m_state;
    
};

#endif /* ConcreateSubject_hpp */
